Method of implementing B++ tree search on parallel using virtual tree structure

ABSTRACT

The present invention relates to a method of implementing B++ tree search on parallel for virtual tree searcher, in which there is no need to construct and maintain tree structure. In each search step, all processor units (PUs) can be involved to complete search operation. Such kind of searcher can be implemented on hardware with low developing and production cost.

BACKGROUND OF THE INVENTION

(a). Field of the Invention

The present invention relates to a method of implementing B++ tree search on parallel using virtual tree structure. This method can process virtual B++ tree structure search on parallel environment. All Processor Units (PUs) can be fully involved in each step to complete the search operation.

(b). Description of the Prior Arts

Since earlier computer developing stage, many researchers had been devoted to study different search methods. Today, these methods are quite mutual. Some researchers proposed several parallel search methods. But their results are dissatisfactory. Because, it is difficult to allow all PUs involving on searching distributed data in each search step. The complexity of constructing and maintaining tree structure on parallel environment is large. The production cost for this type of hardware searcher is too high.

In 1980's, Japanese proposed the concept of intelligent computers called fifth generation computers, since they posses the superior robotic technology. Japanese government integrated the enterprises and academic forces to promote this project. PROLOG will be utilized as major language in this project. This project is failed because the relative technology is not mutual enough. But the concept of fifth generation computers has been widely accepted. The inventor of this patent had explored object relational database machine in long time, and intended to adopt this machine for next generation computers. Hence solving the bottleneck of fifth generation computers is one of major purposes of this invention.

Presently the personal computer technology has rapid development. Double core CPU becomes popular in the market. It is apparent that parallel and distributed computer architecture becomes the developing trend of computer technology. Tree structure searching methods are widely adopted in the field of database systems. There is a strong need of extra large search capability over extra large data volume in the fields of database, web and artificial intelligence. To response such demand, the inventor proposes this virtual tree search method, which can execute virtual B++ tree search in the parallel environment.

SUMMARY OF THE INVENTION

The main object of the present invention is to provide a parallel virtual tree search method which performs B++ tree search using virtual tree structure. The whole search method can be implemented as software or hardware system. Because of no need to construct tree structure, hardware system can be easily developed. This hardware device can be implemented in the FPGA chips. The developing and production cost can be greatly reduced.

The second object of this invention is to provide two best search embodiments employing a parallel virtual tree search method presented in the invention. One of these search devices can be designed into a interface card which can be connected with a personal computer. Another device can be designed into several interface cards which are distributed to a multiple processor system.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is the example of parallel data distributed to 5 PUs.

FIG. 2 is the virtual B++ tree structure for the example in FIG. 1.

FIG. 3 is the first embodiment in which all PUs are interfaced with a personal computer.

FIG. 4 is the second embodiment in which all PUs are distributed to multiple processor system.

DETAILED DESCRIPTION OF THE INVENTION

In order to let esteemed examiners further recognize and understand the characteristics, objects, and functions of the invention, preferable embodiments cooperating with corresponding drawings are presented in detail thereinafter.

The present invention can be described briefly as the following three aspects:

1. The parallel virtual tree search method according to the present invention can be implemented as a software system, and implemented in a multiple processor system. It can also be implemented as hardware searcher, and such searcher can be designed with Rotate Left/Right capability to perform insert and delete operations.

2. There are m processor units in the system according to the present invention. In each search loop, one PU must in rest state. When m is increasing, the overall performance is only slightly reduced. But, every PU only process data in the corresponding memory unit. Communication cost, maintaining tree cost and extra memory cost can be completely eliminated.

3. This present invention uses virtual tree structure. Every PU can use equation to calculate PATH. PU is in rest state if PATH=0, and PATH is the path number of PU if 1≦PATH≦m−1. PU also calculates the location where the data needs to retrieve for comparison. Such processing method can be implemented in hardware in FPGA chips with low production cost, faster speed and better reliability.

The B++ tree search method used in the present invention is in parallelized manner and can be hardware implemented with low production cost. The detailed description of the present invention is illustrated as below:

1. Assume that N represents the data size and m represents total processor number. N data is ordered according to search key values and is distributed to m memory units which are corresponding to every PU. N is 64 and m is 5 in the example shown in the FIG. 1. It is noted that each Location k (where k is between 1 and 64) contains a search key value and k is merely sequence ordered number. P_(i) is the i-th processor unit where i is between 1 and m. Therefore, the relationship among k, m and i is found: k MOD m=i. In other words, if we want to know the search key value of location k, then this value can be found in the memory of processor unit P_(i).

2. The search key values of data can be sorted and distributed to m PUs. At initial, host sends BlockSize=64, UpperBound=64, m=5, height=

log_(m−1)N

=3 and Prepath=4 to all processors. This search example can be completed in 3 loops with 3 comparisons in worst case. If search value is found earlier by a processor, this processor will broadcast stop signal to all processor. Assume the search criterion can be found at Location=38. The proposed algorithm can be described in detail as below:

(2a). At loop 1, all PUs will process BlockSize=BlockSize/(m−1)=16, UpperBound=64 and UpperBound MOD m=4. Therefore, all PUs know P₄ represents Prepath=4 with location=64. Since loop number is odd, processor numbers must be increasing when corresponding path numbers are increasing. Each processor can calculate his representing path and the location to retrieve data. In FIG. 2, P₁˜P₄ represents path 1˜4, and P₅ must take a rest (represents path 0). P₁˜P₄ will retrieve data at location 16, 32, 48 and 64. Finally P₃ finds that the search criterion is in his range, and broadcast path=3 to Prepath values in all PUs.

(2b). At loop 2, BlockSize=4, UpperBound=48 and UpperBound MOD m=3. P₃ represents PATH=4 with location=48. Since loop number is even, processor numbers must be decreasing when corresponding path numbers are increasing. Each processor can calculate his representing path and the location to retrieve data. In FIG. 2, P₁, P₅, P₄, P₃ represents path 1˜4, and P₂ must take a rest. P₁, P₅, P₄ and P₃ will retrieve data at location 36, 40, 44 and 64. P₅ finds that the search criterion is in his range, and broadcast path=2 to Prepath values in all PUs.

(2c). At loop 3, BlockSize=1, UpperBound=40 and UpperBound MOD m=0. P₅ represents path=4 with location=40. Loop number is odd again. In FIG. 2, P₂, P₃, P₄ and P₅ represents path 1˜4, and P₁ must take a rest. P₂, P₃, P₄ and P₅ will retrieve data at location 37, 38, 39, and 40. P₃ finds that the search criterion at location 38, and broadcast a stop signal to all processors.

3. The complete virtual tree structure of the proposed search method is showing in FIG. 2. In each loop, P₁ to P₅ can use the equations to calculate the representing path and the location of comparing data. This system can be faster and more reliable if this search method can be designed into a hardware system.

4. Two preferred embodiments according to the present invention are illustrated in FIG. 3 and FIG. 4. These two devices can be incorporated with rotate left/right capability. In FIG. 3, all PUs are designed in a interface card. This design is suitable for personal computer. In FIG. 4, parallel search network is designed into several interface cards. These cards are distributed and implemented in multiple processor systems, such as PC Cluster, cubic system, etc.

As shown in FIG. 3, parallel searcher is designed as the interface card of personal computer. All adjacent PUs are connected as a circle which can process rotate left/right. When insert operation is implemented, search the Location I of inserting data first. Then all data from N down to I rotate right one position. Finally, insert operation can be completed by inserting data into Location I. Similar in delete operation, deleting data at Location I is found first. Then all data from I+1 to N are shift right one position.

In FIG. 4, each PU is designed into an interface card for each computer of PC cluster. The primary level processing system is including cluster computers and PUs of our searcher. The second level is a parallel hardware sorter which is used to do sorting, inserting, deleting operations.

When search is processed, one PU must be in rest state in each step. If m is increased, the system performance is increased with complexity:

log_(m−1)N

. But, the hardware complexity is only increasing linearly. Each PU only processes data located at the corresponding memory unit. Virtual tree can be adopted and tree maintaining cost can be completely eliminated. Therefore, this searching method can be pure hardware implemented and can be designed into FPGA chips. The developing and production cost can be greatly reduced.

This present invention can provide fast search among huge data volume which is desperately needed in the deduce process of PROLOG machine. The most significance of the present invention is providing the key technique which can overcome the bottleneck of next generation intelligence computer systems. Computer can be upgraded to “Electronic Brain”. All technical fields require large search capability among huge data can employ the present invention. For examples, computer network industry can use it to build their search engine, and search domain name for IP address. Object-relational database industry can use it for searching object ID. Medical and bioinformatics industry can use it for drug discovery, disease diagnosis and system biology researches.

While the present invention has been shown and described with reference to two preferred embodiments thereof, and in terms of the illustrative drawings, it should be not considered as limited thereby. Those who skilled in the art should appreciate that they can readily use the disclosed conception and specific embodiments as a basis for designing or modifying data structures for carrying out the same purpose of the present invention, and that various possible changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims. 

1. A virtual tree parallel searching method, which uses multiple processor units to search data, when said method is used to search among distributed and ordered data, small part of processor units are remained in a rest state, and major part of processor units are activated in each searching loop, therefore every processor unit only processes data located in its corresponding memory unit, and a virtual tree structure can be adopted to complete parallel data searching.
 2. The virtual tree parallel searching method of claim 1, when said method is utilized to search data on parallel, the searching can be completed within

log_(m−1)N

loops, wherein m is a total number of processor units and N is a total data number, after initial values are set up, the following steps are executed in each loop: (2a). Every processor knows the size of search range in the loop and the corresponding location within the complete data; (2b). Each unit of m PUs divides the size of search range described in Step (2a) into m−1 equivalent parts; (2c). These m−1 equivalent data parts are distributed to m−1 processor units and one processor unit is at a rest state; and (2d). The m−1 processor units detect if the search criteria value is in their range, if one processor unit finds the exact location of criteria value, then a signal is generated to stop the searching operation, otherwise, a processor unit finds that criteria value is located in it's rang, the unit will notice the others and enter into the next loop.
 3. The virtual tree parallel searching method of claim 1, wherein in said Step (2a), the corresponding location within the complete data can be derived from the following equation: UpperBound=UpperBound−BlockSize*(m−1−PrePath); wherein BlockSize is total data searching range in the loop, UpperBound is the location of maximum value in this range, PrePath is the previous PATH value in the previous loop, at initial, these parameters are set as: BlockSize=N, UpperBound=N, and PrePath=m−1.
 4. The virtual tree parallel searching method of claim 1, in the Step (2b), the total data range in the loop (BlockSize) can be divided into m−1 equivalent parts, as the following equation: BlockSize=BlockSize/(m−1), wherein the BlockSize becomes the data range assigned to each processor unit.
 5. The virtual tree parallel searching method of claim 1, in the Step (2c), can further comprise the following two steps: (5a) The location of maximum value in the loop is UpperBound, from equation j=UpperBound MOD m, the UpperBound is located in the memory unit of processor unit p_(j), and PATH value of p_(j) must be m−1; and (5b) If loop number is odd, then the sequence of processor unit is increased according to the increasing PATH values, otherwise, if loop number is even, then the sequence of processor unit is decreased according to the increasing PATH values, the following equations can be used to calculate PATH value that represents for each processor unit p_(i) where 1≦i≦m−1: PATH=i+m−j−1 if loop number is odd and i≦j; PATH=i−j−1 if loop number is odd and i>j; PATH=m+j−i−1 if loop number is even and i≧j; PATH=j−i−1 if loop number is even and i<j; if PATH value is 0, it means pi is in a rest state, otherwise, the path of pi is between 1 and m−1.
 6. The virtual tree parallel searching method of claim 1, in the Step (2d), the location of the data comparing with criteria is Location=UpperBound−BlockSize*(m−PATH−1). If p_(i) detects that criteria is in its searching range, the PATH value is passed to all processor units, the PrePath of all processor units are changed to the passed value.
 7. The virtual tree parallel searching method of claim 1 or 2, said method can be implemented as software and processed in multiple processor systems such as PC cluster or Cubic array.
 8. The virtual tree parallel searching method of claim 1 or 2, said method can be implemented as m hardware modules, each module includes a processor unit and a corresponding memory unit.
 9. The virtual tree parallel searching method of claim 8, said method can be implemented as m hardware modules, and said modules can be built in an interface card, and the card can be connected with PC/person computer, and the m modules can be built into m interface cards and the cards are distributed and processed in multiple processor systems such as PC cluster or Cubic array system. 